<template>
  <view class="view_box">
    <block v-for="(item, index) in list" :key="index">
      <view :class="list.length > 1 ? 'good_list_small' : 'good_list'" v-if="item.isGift != 1">
        <view :class="list.length > 1 ? 'image_box_small' : 'image_box'">
          <image :src="item.skuImageUrl"></image>
        </view>
        <view class="textInfo">
          <view class="item_name">{{ item.itemName }}</view>
          <view class="product_info">
            <view class="other_text">{{ item.skuProperties[0].valueName }}</view>
            <view class="other_text">x{{ item.qty ? item.qty : item.num }}</view>
          </view>
          <view class="c2b_view" v-if="isC2b">
            <view class="title">含个性化定制服务</view>
            <view @click.stop="handleCustomizationDetails(item)" class="copybtn_style">查看镌刻</view>
          </view>
          <view class="price_box">
            <view class="other_text">{{ list.length > 1 ? '金额：' : '合计：' }}</view>
            <view class="other_text"><text class="other_text_mark">￥</text>{{
              filterChecked.moneyFormat(item.divideOrderFee / 1, 2)}}</view>
          </view>
        </view>
      </view>
    </block>
  </view>
</template>
<script module="filterChecked" lang="wxs" src="../../utils/filter.wxs"></script>
<script>
  import tip from '@/utils/tip';
  import api from '@/api/api';
  import {
    SYSTEM_INFO,
    USER_SPECICAL_INFO
  } from '@/utils/constant';

  export default {
    props: {
      goodsList: {
        default: []
      },
      orderCode: {
        type: String
      },
      list: {
        type: Array
      },
      isRefundList: {
        default: 'N'
      },
      imageHeight: {
        type: Number
      },
			isC2b: {
				type: Boolean,
			  default: false
			},

    },

    data() {
      return {
        lookDetail: false,
        orderNo: '',
        refundId: '',
        // valueName:'',
        itemStatus: {
          NO_REFUND: '可退款',
          WAIT_SELLER_AGREE: '待审核',
          WAIT_BUYER_RETURN_GOODS: '待退货',
          WAIT_SELLER_CONFIRM_GOODS: '待退款',
          SUCCESS: '退款成功',
          CLOSED: '已关闭',
          RETAIL_STORE_RECEIVED: '门店已收货',
          DC_RECEIVED: '仓库已收货'
        }
      };
    },
    methods: {
      refreshList(val) {
        if (val == undefined) return;
        this.list = val;
      },
			handleCustomizationDetails(item){
				this.$emit('onCustomizationDetails',item.orderId)
			},
    },
    onLoad() {
      this.list = [];
    }
  };
</script>
<style lang="less">
.view_box {
  font-family: FrankNew-Regular, NotoSansSC-Regular;
}

.good_list {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.good_list_small {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 32rpx;
}

.good_list_small:first-child {
  margin-top: 16rpx;
}

.image_box {
  width: 192rpx;
  height: 256rpx;
  flex-shrink: 0;

  image {
    width: 100%;
    height: 100%;
  }
}

.image_box_small {
  width: 156rpx;
  height: 208rpx;
  flex-shrink: 0;

  image {
    width: 100%;
    height: 100%;
  }
}

.other_text {
  font-family: FrankNew-Regular;
  font-size: 24rpx;
  font-weight: normal;
  line-height: 40rpx;
  color: #757575;
}

.other_text_mark {
  font-family: NotoSansSC-Regular !important;
}

.product_info {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.item_name {
  width: 100%;
  height: 80rpx;
  font-family: NotoSansSC-Regular;
  font-size: 24rpx;
  font-weight: normal;
  line-height: 40rpx;
  color: #000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  margin-bottom: 2px;
}

.price_box {
  margin-top: 28rpx;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.c2b_view {
  width: 100%;
  height: 42rpx;
  line-height: 42rpx;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 8rpx;

  .title {
    font-family: NotoSansSC-Regular;
    color: #757575;
    font-size: 24rpx;
    font-weight: 500;
  }

  .copybtn_style {
    border-bottom: 1px solid #000;
    font-family: NotoSansSC-Regular;
    font-size: 24rpx;
    font-weight: 500;
    color: #000;
    padding-top: 4rpx;
  }
}
</style>
